The getExecutions method returns an array of Execution objects.
var getExecutions(symbol, beginTime, endTime);
symbol
String value representing a symbol for which to return executions. If null is specified, the symbol check is removed.
beginTime
JavaScript Date object instance representing the start of date/time range. If null is specified, the date/time range check is removed.
endTime
JavaScript Date object instance representing the end of date/time range. If null is specified, the date/time range check is removed.
If either one of beginTime or endTime parameters is null, make sure the other parameter is also null.
This method returns an array of Execution objects. If either parameter is invalid, the method returns a null.
The following example demonstrates the use of getExecutions() method. The code attempts to retrieve all executions that happened in current day from midnight until market time.
function start()
{
//get current account
var account = getAccount();
//get current market date/time
var currMarketDate = Application.getCurrentMarketTime();
//create new Date object based on current's market midnight
var marketMidnightDate = new Date(currMarketDate.getYear(), /*year*/
currMarketDate.getMonth(), /*month*/
currMarketDate.getDate(), /*date*/
0, /*hours*/
0, /*minutes*/
0, /*seconds*/);
//retrieve our executions from current day's midnight until now
var executions = account.getExecutions(null, marketMidnightDate, currMarketDate);
for(var i = 0; i < executions.length; i++)
{
var execution = executions[i];
...
...
}
}
start(), getAccount(), Execution Class
Copyright © 2006-2009 ActiveTick LLC